package com.yl.auth.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yl.auth.model.entity.Wenyu;
import com.yl.auth.model.vo.WenyuVo;
import com.yl.auth.service.WenyuService;
import com.yl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "小程序-老人文娱")
@RestController
@RequestMapping("/admin/xiaochengxuwenyu")
public class Xiaochengxuwenyu {
    @Resource
    private WenyuService wenyuService;

    @GetMapping("/getxiaowenyu")
    @ApiOperation(value = "小程序获取全部精神慰藉信息")
    public Result getxiaowenyu(){
        List<WenyuVo> wenyuVoList = wenyuService.getxiaowenyu();
        return Result.ok(wenyuVoList);
    }
    @PostMapping("/addwenyu")
    @ApiOperation(value = "添加文娱")
    public Result addweiji(Wenyu wenyu){
        wenyuService.save(wenyu);
        return Result.ok();
    }
}